 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Pragma" content="no-cache">
        <title>alphaTab - Demo</title>
		<!-- Dependencies -->
		<!--[if IE]><script language="JavaScript" type="text/javascript" src="../lib/excanvas/excanvas.js"></script><![endif]-->
		<script language="JavaScript" type="text/javascript" src="../lib/jquery/jquery.min.js"></script>
		
		<!-- alphaTab -->
		<script language="JavaScript" type="text/javascript" src="../lib/alphaTab/alphaTab.min.js"></script>
		<script language="JavaScript" type="text/javascript" src="../lib/alphaTab/jquery.alphaTab.min.js"></script>
        <style type="text/css">@import url('style.css');</style>
        <style type="text/css">@import url('alphaTab.css');</style>
    </head>
	<body>
		<div id="TopNavWrapper">
			<div id="TopNav">
				<a href="http://www.alphatab.net" id="AlphaTabLogo" title="Home"></a>
				<ul>
				</ul>
			</div>
		</div>
		<div id="Content">
		<h1>alphaTab - Songmodel</h1>
				<a href="index.html">Back</a>
				
		<p>This sample shows how to load a file and access the songmodel.</p>
		  
<script language="JavaScript" type="text/javascript">  
$(document).ready(function() { 
	try
	{
		// use SongLoader to load files
		var factory = new alphatab.tablature.model.SongFactoryImpl();
        alphatab.file.SongLoader.loadSong('files/FadeToBlack.gp4', factory, 
			function(song){ 
				var info = $('#Info');
				// access data
				info.append('<p><b>Title:</b> '+song.title+'</p>');
				info.append('<p><b>Subtitle:</b> '+song.subtitle+'</p>');
				info.append('<p><b>Album:</b> '+song.album+'</p>');
				info.append('<p><b>Tempo:</b> '+song.tempo+'</p>');
				info.append('<p><b>Measures:</b> '+song.measureHeaders.length+'</p>');
				info.append('<p><b>Tracks:</b> ('+song.tracks.length+')</p>');
				var tracks = $('<ul></ul>');
				for(var i = 0; i < song.tracks.length; i++) {
					tracks.append('<li>'+song.tracks[i].name+'</li>');
				}
				info.append(tracks);
		});
	}
	catch(e)
	{
		if(e instanceof alphatab.file.FileFormatException)
			alert(e.message);
		else 
			alert(e);
	}
});
</script>
<fieldset>
	<legend>FadeToBlack.gp4</legend>
	<div id="Info"></div>
</fieldset>				<h2>Source</h2>
		<code>&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;  
$(document).ready(function() { 
	try
	{
		// use SongLoader to load files
		var factory = new alphatab.tablature.model.SongFactoryImpl();
        alphatab.file.SongLoader.loadSong('files/FadeToBlack.gp4', factory, 
			function(song){ 
				var info = $('#Info');
				// access data
				info.append('&lt;p&gt;&lt;b&gt;Title:&lt;/b&gt; '+song.title+'&lt;/p&gt;');
				info.append('&lt;p&gt;&lt;b&gt;Subtitle:&lt;/b&gt; '+song.subtitle+'&lt;/p&gt;');
				info.append('&lt;p&gt;&lt;b&gt;Album:&lt;/b&gt; '+song.album+'&lt;/p&gt;');
				info.append('&lt;p&gt;&lt;b&gt;Tempo:&lt;/b&gt; '+song.tempo+'&lt;/p&gt;');
				info.append('&lt;p&gt;&lt;b&gt;Measures:&lt;/b&gt; '+song.measureHeaders.length+'&lt;/p&gt;');
				info.append('&lt;p&gt;&lt;b&gt;Tracks:&lt;/b&gt; ('+song.tracks.length+')&lt;/p&gt;');
				var tracks = $('&lt;ul&gt;&lt;/ul&gt;');
				for(var i = 0; i &lt; song.tracks.length; i++) {
					tracks.append('&lt;li&gt;'+song.tracks[i].name+'&lt;/li&gt;');
				}
				info.append(tracks);
		});
	}
	catch(e)
	{
		if(e instanceof alphatab.file.FileFormatException)
			alert(e.message);
		else 
			alert(e);
	}
});
&lt;/script&gt;
&lt;fieldset&gt;
	&lt;legend&gt;FadeToBlack.gp4&lt;/legend&gt;
	&lt;div id=&quot;Info&quot;&gt;&lt;/div&gt;
&lt;/fieldset&gt;</code>
		    </body>
</html>				
				
